<?php
class MY_Controller extends MX_Controller
{
 function __construct($module_id=null)
	{
		parent::__construct();	

		
		$this->load->model('user/model_user');
		
		if(!$this->model_user->is_logged_in())
		{
			
			redirect('user/login');
		}
		
		/*
		if(!$this->model_user->has_permission($module_id,$this->model_user->get_logged_in_user_info()->user_id))
		{
			redirect('no_access/'.$module_id);
		}
		*/
		//load up global data
		$logged_in_user_info=$this->model_user->get_logged_in_user_info();
		$this->load->model('user/model_module');
		$data['allowed_modules']=$this->model_module->get_allowed_module($logged_in_user_info->user_id);
		$data['user_info']=$logged_in_user_info;
		$this->load->vars($data);

	}
}
?>